<template>
  <div class="song-list">
    <div class="list-top">
      <div class="top-left">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-bofang_play" />
        </svg>
        <div class="play">播放全部</div>
        <div class="num">(共{{detail.tracks.length}}首)</div>
      </div>
      <div class="top-right">
        <div class="iconItem">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-xiazai" />
          </svg>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-duoxuan" />
          </svg>
        </div>
      </div>
    </div>

    <div class="song-content">
      <div class="song" v-for="(item,i) in detail.tracks" :key="item.id" @click="setPlay(i)">
        <div class="song-left">
          <span class="num">{{i+1}}</span>
          <div class="song-information">
            <div class="song-title">{{item.al.name}}</div>
            <div class="singer">{{item.ar[0].name}}</div>
          </div>
        </div>
        <div class="song-right">
          <svg class="icon play" aria-hidden="true">
            <use xlink:href="#icon-bofang1" />
          </svg>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-gengduo" />
          </svg>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { mapMutations } from "vuex";
export default {
  methods: {
    ...mapMutations(["setPlay"])
  },

  props: ["detail"]
};
</script>
<style scoped lang="less">
.song-list {
  border: 1px solid #ccc;
  border-top-left-radius: 0.3rem;
  border-top-right-radius: 0.3rem;
  padding: 0.3rem 0.2rem;
  margin-bottom: 1rem;
  .list-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .top-left {
      display: flex;
      align-items: center;
      .icon {
        fill: red;
        font-size: 0.5rem;
        margin-right: 0.2rem;
      }
      .play {
        font-size: 0.32rem;
      }
      .num {
        font-size: 0.24rem;
        color: #ccc;
      }
    }
    .top-right {
      .icon {
        font-size: 0.5rem;
        margin-right: 0.3rem;
        fill: white;
      }
    }
  }
  .song-content {
    .song {
      margin-top: 0.2rem;

      display: flex;
      justify-content: space-between;
      .song-left {
        display: flex;
        align-items: center;
        .num {
          font-size: 0.4rem;
          font-weight: 400;
          color: #aaa;
          width: 1rem;
          height: 1rem;
          line-height: 1rem;
          margin-left: 0.2rem;
        }
        .song-information {
          .song-title {
            font-size: 0.28rem;
          }
          .singer {
            font-family: "微软雅黑";
            font-size: 0.22rem;
            color: #c2c2c2;
          }
        }
      }
      .song-right {
        display: flex;
        align-items: center;
        .icon {
          width: 0.4rem;
          height: 0.4rem;
          fill: #aaa;
        }
        .play {
          margin-right: 0.3rem;
        }
      }
    }
  }
}
</style>